package cc3002;

/**
 * The most dangerous Food. It can be very useful as it's dangerous. When eaten, you'll get Really Sick 
 * (if you are Sick or better) or you'll die (if you are Really Sick). Each bite gives 1000 calories
 * (if Health State is Normal).
 * @author Anibal Llanos Prado
 *
 */
public class DeadlyRib extends WeirdFood{
	
	/**
	 * Creates a Deadly Rib with standard values. Only 1 bite per Rib.
	 */
	public DeadlyRib(){
		this.remainingBites=1;
		this.goodStackLimit=9;
		this.badStackLimit=0;
		this.sicknessLimit=10;
		this.caloriesPerBite=1000;
		this.name="Deadly Rib";
		this.bad=good=0;
	}
	
	/**
	 * Bites the food. This method is overridden to modify it behavior.
	 * @param health The Health State of the biter.
	 */
	@Override
	public int bite(HealthState health){
		assert remainingBites!=0:"Nothing to eat";
		if(remainingBites==0)return 0;
		--remainingBites;
		int aux=(int)(caloriesPerBite*health.getFoodMultiplier());
		modifyHealth(health);
		return aux;
	}

	/**
	 * Allows you to modify the Health State. This method is overridden to modify it behavior. Now
	 * only decides if you die or you will only get about to.
	 * @param health The Health State of the modified.
	 */
	@Override
	protected void modifyHealth(HealthState health){
		if(health.getState()>1)health.setState(1);
		else health.getWorst();
	}
	
}
